home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
keyb
/
fixpat12.zip
/
FIXPATH.DOC
< prev
Wrap
Text File
|
1994-04-08
|
5KB
|
118 lines
FixPath v1.2
-------------
Public Domain Software by Jean-Marc Lasgouttes.
Jean-Marc.Lasgouttes@inria.fr
FixPath is a small TSR (96 bytes at most!) that removes the trailing
backslash of directory names on the command line. When using a
command-line editor with filename completion, one often ends-up with a
command like:
C:\>cd dos\
DOS will not accept such a command, because it does not recognize directory
names that end with '\'. Before COMMAND.COM sees it, FixPath will modify
it to:
C:\>cd dos
You will soon find that this simple feature saves you a lot of time because
you will not have to issue commands twice just because you forgot to remove
the backslash of "copy *.* temp\".
There is one exception to that: when the command begins with a space
character, it will not be modified by FixPath. This allows to type
complex commands flawlessly. I have been told for example that some
archivers will behave differently depending on the backslash at the
end of directory names. XCOPY is another familiar command that needs
the ending \ for a purpose.
FixPath must be installed just after your favorite command-line editor. It
has been tested with Dosed v5.0 (highly recommended BTW) and should also
work with CmdEdit and others. It is not needed with Wced 1.8, since I
stole the idea of FixPath from there :-)
The installation of FixPath is as simple as typing "FixPath". If FixPath
can find a memory hole in which it can install itself, it will use no
memory at all. Otherwise, it will use a mere 96 bytes! The only possible
argument that you can specify is "/u" to uninstall FixPath from memory.
Any other argument will display a short syntax help.
Let's get technical
--------------------
FixPath has been written in SPHINX C--, a freely available language written
by Peter Cellik (thanks Peter!). C-- is a sort of low-level C that allows
to mix freely high-level C-like constructs and assembly instructions. I
recommend wholeheartedly that you to take a look at it. The latest version
at the time of this writing is
oak.oakland.edu:/pub/msdos/misclang/c--0190a.zip.
The algorithm used to remove the '\' is the following: FixPath will remove
any backslash which is followed by a space or a carriage return if and only
if it is not preceded by a space or a colon. This takes care of most cases
that I encountered. See however the "Known bugs and limitations" section
below.
What makes FixPath so small was inspired is a clever technique that I stole
from the screen-saver ss_80b (garbo.uwasa.fi:/pub/pc/screen/ss_80b.zip).
Instead of using the classical Terminate and Stay Resident DOS call,
FixPath relocates itself into a memory block that it has allocated. This
allows to avoid the overhead of the Program Segment Prefix (which take
usually 256 bytes). I would be glad to hear of any problem this weird
method may cause.
The installation check is done by inspecting the Memory Control Block chain
and looking for a block named "FIXPATH" which owns itself and is not the
current program. Since FixPath writes itself its name in the MCB, this
method should be safe with any version of DOS since 2.0. However, I am not
sure of what happens when the program is loaded high.
Known bugs and limitations
---------------------------
Since FixPath has been written for my own use, it has a lot of
limitations. However, if there is some interest for the program, I will be
happy to try to enhance it. If any of these limitations is a problem for
you, please let me know.
- the backslash are not really removed, but replaced with spaces;
- FixPath will also do its job in programs like Debug or V. Buerg's
List. This is not necessarily what you want. A fix for that could be
implemented under DOS 4+, but I did not write it yet;
- some people type "cd\" to go to the root directory. This will be
transformed into "cd", which has a different meaning;
- there is no visual way to see how the command line has been really
modified. This could be a problem since the algorithm used is not
really foolproof for complex commands. However, if you really want to know,
type "echo" in front of your command;
- the algorithm considers only the space as a valid separator. The
comma could be considered also;
- text enclosed in double quotes should perhaps be skipped.
History
--------
1.0: - Initial release.
1.1: - fixed a bug where a directory name like 'C:\' was not handled
correctly;
- changed the initialization of the program. It uses now 96 bytes of
memory instead of 160!
1.2: - New memory allocation strategy: FixPath is now able to fill memory
holes and will in most cases use *no* memory!
- FixPath checks whether it is already installed and refuses to
install over itself;
- new uninstall feature;
- short syntax help;
- the screen output of the program can be redirected.